<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>弹性盒</title>
  <style>
    .box {
      width: 500px;
      height: 500px;
      border: 2px solid black;
      margin: 100px auto;
      display: flex;
      /* 弹性盒 */

      flex-direction:row;
      /* 调整主轴是行是列，row行，column列，row-verse行的反方向，column-reverse列的反方向 */

      justify-content: space-around;
      /* 调整主轴对齐方向
            flex-start 左对齐
            flex-end 右对齐
            center 居中

            space-between 两端对齐
            space-around 距离环绕
            */

      align-items: flex-start;
      /* 调整侧轴对齐方向
             flex-start
             flex-end
             center
            */
    }

    .box span {
      width: 50px;
      height: 50px;
      border: 1px dashed red;
    }
    .box div {
      width: 50px;
      height: 50px;
      border: 1px dashed red;
    }
    img{
    width: 50px;
    height: 50px;  }
  </style>
</head>

<body>
  <!-- 弹性盒是一种新的布局方式，特别适合移动端布局 -->
  <!-- 影响:
    1.子元素默认横向排列
    2.行内元素，变成了块级元素
    3.只有一个元素的时候，margin：auto 自动居中
    -->
  <div class="box">
    <span><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></span>
    <span><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></span>
    <span><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></span>
    <span><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></span>
    <span><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></span>

  </div>

  <div class="box">
    <div><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></div>
    <div><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></div>
    <div><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></div>
    <div><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></div>
    <div><img src="https://readerstar2.oss-cn-beijing.aliyuncs.com/system/avatar/2.jpg" alt=""></div>
  </div>
</body>

</html>